﻿@using Seal.Model;
@{
    ReportViewTemplate Template = Model;

    //Template Name
    Template.Name = "KPI";
    Template.Description = "Display a Key Performance Indicator.\r\nThe KPI is built from a data table result with at least 2 columns: 1 for the dimension, 1 for the measure (with optionals columns to define the goal if the column name has the _GOAL suffix).";

    //If true, the view can be configured for a report model
    Template.ForReportModel = false;
    Template.IsModelViewChild = true;

    //Parameters for this template
    Template.Parameters.Add(new Parameter() { Name = "kpi_class", DisplayName = "CSS class: Container", TextValue = "text-center", Description = "CSS class attribute of the main DIV container.", Enums = new string[] { "text-center;" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "kpi_css", DisplayName = "CSS style: Container", TextValue="", Description = "CSS style attribute of the main DIV container.", Enums = new string[] { "width:250px;", "width:100%;margin:10px;", "padding:10px;", "font-size: 10px;" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "kpi_show_header", BoolValue = true, DisplayName = "Show header value", Description = "If true, the header value is shown." });
    Template.Parameters.Add(new Parameter() { Name = "kpi_show_value", BoolValue = true, DisplayName = "Show value", Description = "If true, the value is shown." });
    Template.Parameters.Add(new Parameter() { Name = "kpi_button_css", Value = "margin-top:5px;cursor:default;", DisplayName = "CSS style: KPI Button", Description = "CSS style attribute of the KPI button.", Enums = new string[] { "margin-top:5px;cursor:default;width:260px", "padding:10px;", "font-size:10px;" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "kpi_goal_css", Value = "margin-top:0px;font-size:12px;", DisplayName = "CSS style: Goal button", Description = "CSS style attribute of the goal button.", Enums = new string[] { "margin-top:0px;font-size:14px;width:260px;display:inline-block;", "padding:10px;", "font-size:10px;" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "kpi_trend_index", NumericValue = -1, DisplayName = "Trend percentage: Index of the value to use", Description = "The index (from the last row) of the value to use to calculate the trend precentage. If -1 is set, the value of the first row of the table is used. If 1 is set, the value of the row before the last row is used. If 0 is set, the trend badge is not displayed." });
    Template.Parameters.Add(new Parameter() { Name = "kpi_trend_color_useval", BoolValue = false, DisplayName = "Trend colors: Use measure value", Description = "If true, the value of the measure is used (instead of the trend value) for the button colors." });
    Template.Parameters.Add(new Parameter() { Name = "kpi_trend_color", DisplayName = "Trend colors", TextValue= "btn-danger|-10\r\nbtn-warning|0\r\nbtn-primary|1\r\nbtn-success", Description = "List of (button colors and trend percentage value) to define the trend colors per range. Color and percentage value are separated by |."});
    Template.Parameters.Add(new Parameter() { Name = "kpi_trend_icon_useval", BoolValue = false, DisplayName = "Trend icons: Use measure value", Description = "If true, the value of the measure is used (instead of the trend value) for the button icons." });
    Template.Parameters.Add(new Parameter() { Name = "kpi_trend_icon", DisplayName = "Trend icons", TextValue = "glyphicon glyphicon-import|0\r\nglyphicon glyphicon-option-horizontal|1\r\nglyphicon glyphicon-export", Description = "List of (icons and trend percentage value) to define the trend icons per range. Icons and percentage value are separated by |. If set to 'none', no icon is shown."});
    Template.Parameters.Add(new Parameter() { Name = "kpi_trend_pct_format", DisplayName = "Trend % format", TextValue = "{0:+0;-0;0} %", Description="The .Net format of the trend percentage value.", Enums = new string[] { "{0:+0.00;-0.00;0.00} %" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "kpi_goal_color", DisplayName = "Goal colors", TextValue = "label-danger|-10\r\nlabel-warning|0\r\nlabel-primary|1\r\nlabel-success", Description = "List of (button colors and goal percentage value) to define the goal colors per range. Color and percentage value are separated by |." });
    Template.Parameters.Add(new Parameter() { Name = "kpi_goal_icon", DisplayName = "Goal icons", TextValue = "glyphicon glyphicon-circle-arrow-down|0\r\nglyphicon glyphicon-ok", Description = "List of (icons and goal percentage value) to define the goal icons per range. Icons and percentage value are separated by |. If set to 'none', no icon is shown." });
    Template.Parameters.Add(new Parameter() { Name = "kpi_goal_pct_format", DisplayName = "Goal % format", TextValue = "{0:+0;-0;0} %", Description = "The .Net format of the goal percentage value. If set to 'none', no percentage is shown.", Enums = new string[] { "{0:+0.00;-0.00;0.00} %", "none" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "kpi_button_size", DisplayName = "Button size", Description = "Size of the buttons used to display the values.", Enums = new string[] { "|default", "btn-lg|large", "btn-sm|small", "btn-xs|very small" }, UseOnlyEnumValues = true });

    //Allowed template parent names
    Template.ParentNames = new List<string>() { "Model", "Container", "Container Grid Flex", "Widget", "Tab Page" };
}
  